<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.cg.slms.domain.*,java.util.*"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	if (request.getAttribute("client") == null) {
		Client client = new Client();
		request.setAttribute("client", client);
	}
%>

<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>客户档案</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<script language="javascript" src="script/main.js"></script>
<script language="javascript">
	function deleteRecord(url) {
		if (window.confirm("确定要删除选中的记录吗？")) {
			window.location=url;
		}
	}
</script>
</head>
<body>
	<div style="text-align: center;">

		
		
		<br>
		<div class="modify" style="position:relative;top:28px">	
			<div style="">
				
					<form:form action="clientAction" method="post" modelAttribute="client">
						<table border="0" cellpadding="1" cellspacing="1" width="95%" >
							<tr>
								<td align="right" width="10%" style="font-size:20px;position:relative;left:60px;top:20px">客户编号</td>
								<td width="20%"><form:input path="code" class="form-control" style="position:relative;top:20px;left:64px"></form:input></td>
								<td align="right" width="10%" style="font-size:20px;position:relative;left:80px;top:20px" >客户名称</td>
								<td width="20%"><form:input path="name" class="form-control" style="position:relative;top:20px;left:90px"></form:input></td>
								<td width="40%">&nbsp;</td>
							</tr>
							<tr>
								<td align="right" width="10%">&nbsp;</td>
								<td width="20%">&nbsp;</td>
								<td width="70%" colspan="5">&nbsp;</td>
							</tr>
						</table>
	
	<div style="margin-left: 30px; margin-right: 0px">
	<table border="0" cellpadding="0" cellspacing="0" width="95%" >
		<tr>
			<td width="5%"><input type="submit" value="查找"
				class="btn btn-info" style="position:relative;left:910px;top:-43px" /></td>
			<td width="10%"><input type="button" style="position:relative;left:910px;top:-43px" class="btn btn-info" 
				value="新增" onclick="window.location.href('<%=basePath%>moduls/archive/addClient.jsp')"></td>
			<!-- <td width="10%"><input type="button" onClick="" value="删除"
				class="BtnAction" /></td>
			<td width="10%"><input type="reset" value="重置" class="BtnAction" /></td>-->
			<td width="60%">&nbsp;</td> 
		</tr>
	</table>
	</div>

	<p></p>

	<div style="margin-left: 30px; margin-right: 0px">
	<table width="90%" border="0" cellpadding="0" cellspacing="0" class="table table-striped">
		<tr>
			<td width="3%" class="td_title">删除</td>
			<td width="3%" class="td_title">修改</td>
			<td width="10%" class="td_title">客户编号</td>
			<td width="15%" class="td_title">客户名称</td>
			<td width="15%" class="td_title">地址</td>
			<td width="8%" class="td_title">电话</td>
			<td width="15%" class="td_title">Email</td>
		</tr>
		<c:if test="${!empty requestScope.clients}">
			<c:forEach items="${requestScope.clients}" var="cli">
				<tr>
					<td class="td_border" align="center">
						<a href="javascript:deleteRecord('deleteClientByIdAction?id=${cli.id}')">
							<img src="image/wrong.gif" border="0"/>
						</a>
					</td>
					<td class="td_border" align="center">
						<a href="findClientByIdAction?id=${cli.id}">
							<img src="image/edit.gif" border="0"/>
						</a>
					</td>
					<td class="td_border">${cli.code}</td>
					<td class="td_border">${cli.name}</td>
					<td class="td_border">${cli.address}</td>
					<td class="td_border">${cli.telephone}</td>
					<td class="td_border">${cli.email}</td>
					
				</tr>
			</c:forEach>
		</c:if>
	</table>

	</div>
</form:form>
			
			</div>
		</div>
	
</body>
</html>